#include<iostream>
#include<cmath>
using namespace std;
int n;

int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		int temp = n;
		int ans = 0;
		while (temp) {
			if (temp % 10 != 0) {
				ans++;
			}
			temp /= 10;
		}
		cout << ans << endl;
		int k = 0;
		while (n) {
			if (n % 10 != 0) {
				cout << (n % 10) * pow(10, k) << " ";
			}
			n /= 10;
			k++;
		}
		cout << endl;
	}
	return 0;
}